<?php

namespace App\Entity\Wuliu;

use ApiPlatform\Core\Annotation\ApiResource;
use App\Base\Annotation\Common;
use App\Repository\Wuliu\WuliuOrderRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;

/**
 * @ApiResource()
 * @ORM\Entity(repositoryClass=WuliuOrderRepository::class)
 */
class WuliuOrder
{
    /**
     * @Common(cnName="#",editType="text",listType="text",width="90")
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     * @Groups({"order"})
     */
    private $id;

    /**
     * @Common(cnName="用户",editType="entity",listType="text",width="")
     * @ORM\ManyToOne(targetEntity=WuliuUser::class, inversedBy="wuliuOrders")
     * @Groups({"user"})
     */
    private $user;

    /**
     * @Common(cnName="运送内容",editType="text",listType="text",width="120")
     * @ORM\Column(type="string", length=255, nullable=true)
     * @Groups({"order"})
     */
    private $title;

    /**
     * @Common(cnName="联系电话",editType="text",listType="text",width="160")
     * @ORM\Column(type="string", length=255, nullable=true)
     * @Groups({"order"})
     */
    private $phone;

    /**
     * @Common(cnName="联系人",editType="text",listType="text",width="100")
     * @ORM\Column(type="string", length=255, nullable=true)
     * @Groups({"order"})
     */
    private $contact;

    /**
     * @Common(cnName="发货地址",editType="text",listType="text",width="300")
     * @ORM\Column(type="string", length=255, nullable=true)
     * @Groups({"order"})
     */
    private $startAddress;

    /**
     * @Common(cnName="发货lat",editType="text",listType="text",width="")
     * @ORM\Column(type="float", nullable=true)
     * @Groups({"order"})
     */
    private $startLat;

    /**
     * @Common(cnName="发货lon",editType="text",listType="text",width="")
     * @ORM\Column(type="float", nullable=true)
     * @Groups({"order"})
     */
    private $startLon;

    /**
     * @Common(cnName="收货地址",editType="text",listType="text",width="")
     * @ORM\Column(type="string", length=255, nullable=true)
     * @Groups({"order"})
     */
    private $endAddress;

    /**
     * @Common(cnName="收货lat",editType="text",listType="text",width="")
     * @ORM\Column(type="float", nullable=true)
     * @Groups({"order"})
     */
    private $endLat;

    /**
     * @Common(cnName="收货lon",editType="text",listType="text",width="")
     * @ORM\Column(type="float", nullable=true)
     * @Groups({"order"})
     */
    private $endLon;

    /**
     * @Common(cnName="车辆类型",editType="entity",listType="text",width="")
     * @ORM\ManyToOne(targetEntity=WuliuCars::class, inversedBy="wuliuOrders")
     * @Groups({"order"})
     */
    private $car;

    /**
     * @Groups({"order"})
     * @Common(cnName="货物类型",editType="entity",listType="text",width="")
     * @ORM\ManyToOne(targetEntity=WuliuGoodsType::class, inversedBy="wuliuOrders")
     */
    private $goods;

    /**
     * @Groups({"order"})
     * @Common(cnName="意向价格",editType="text",listType="text",width="")
     * @ORM\Column(type="float", nullable=true)
     */
    private $priceWill;

    /**
     * @Groups({"order"})
     * @Common(cnName="成交价",editType="text",listType="text",width="")
     * @ORM\Column(type="float", nullable=true)
     */
    private $price;

    /**
     * @Groups({"order"})
     * @Common(cnName="备注",editType="text",listType="text",width="")
     * @ORM\Column(type="text", nullable=true)
     */
    private $tips;

    /**
     * @Groups({"order"})
     * @Common(cnName="状态",editType="text",listType="text",width="110")
     * @ORM\Column(type="integer", nullable=true)
     */
    private $status;

    /**
     * @Groups({"order"})
     * @Common(cnName="当前lat",editType="text",listType="text",width="")
     * @ORM\Column(type="float", nullable=true)
     */
    private $curLat;

    /**
     * @Groups({"order"})
     * @Common(cnName="当前lon",editType="text",listType="text",width="")
     * @ORM\Column(type="float", nullable=true)
     */
    private $curLon;

    /**
     * @Groups({"order"})
     * @Common(cnName="订单编号",editType="text",listType="text",width="")
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $sn;

    /**
     * @Groups({"order"})
     * @Common(cnName="装载类型",editType="entity",listType="text",width="")
     * @ORM\ManyToOne(targetEntity=WuliuLoadType::class, inversedBy="wuliuOrders")
     */
    private $loadType;

    /**
     * @Groups({"order"})
     * @Common(cnName="车辆长度",editType="entity",listType="text",width="")
     * @ORM\ManyToOne(targetEntity=WuliuCarType::class, inversedBy="wuliuOrders")
     */
    private $carType;

    /**
     * @Common(cnName="创建时间",editType="datetime",listType="text",width="")
     * @ORM\Column(type="datetime", nullable=true)
     * @Groups({"order"})
     */
    private $createAt;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getUser(): ?WuliuUser
    {
        return $this->user;
    }

    public function setUser(?WuliuUser $user): self
    {
        $this->user = $user;

        return $this;
    }

    public function getPhone(): ?string
    {
        return $this->phone;
    }

    public function setPhone(?string $phone): self
    {
        $this->phone = $phone;

        return $this;
    }

    public function getStartAddress(): ?string
    {
        return $this->startAddress;
    }

    public function setStartAddress(?string $startAddress): self
    {
        $this->startAddress = $startAddress;

        return $this;
    }

    public function getStartLat(): ?float
    {
        return $this->startLat;
    }

    public function setStartLat(?float $startLat): self
    {
        $this->startLat = $startLat;

        return $this;
    }

    public function getStartLon(): ?float
    {
        return $this->startLon;
    }

    public function setStartLon(?float $startLon): self
    {
        $this->startLon = $startLon;

        return $this;
    }

    public function getEndAddress(): ?string
    {
        return $this->endAddress;
    }

    public function setEndAddress(?string $endAddress): self
    {
        $this->endAddress = $endAddress;

        return $this;
    }

    public function getEndLat(): ?float
    {
        return $this->endLat;
    }

    public function setEndLat(?float $endLat): self
    {
        $this->endLat = $endLat;

        return $this;
    }

    public function getEndLon(): ?float
    {
        return $this->endLon;
    }

    public function setEndLon(?float $endLon): self
    {
        $this->endLon = $endLon;

        return $this;
    }

    public function getCar(): ?WuliuCars
    {
        return $this->car;
    }

    public function setCar(?WuliuCars $car): self
    {
        $this->car = $car;

        return $this;
    }

    public function getGoods(): ?WuliuGoodsType
    {
        return $this->goods;
    }

    public function setGoods(?WuliuGoodsType $goods): self
    {
        $this->goods = $goods;

        return $this;
    }

    public function getPriceWill(): ?float
    {
        return $this->priceWill;
    }

    public function setPriceWill(?float $priceWill): self
    {
        $this->priceWill = $priceWill;

        return $this;
    }

    public function getPrice(): ?float
    {
        return $this->price;
    }

    public function setPrice(?float $price): self
    {
        $this->price = $price;

        return $this;
    }

    public function getTips(): ?string
    {
        return $this->tips;
    }

    public function setTips(?string $tips): self
    {
        $this->tips = $tips;

        return $this;
    }

    public function getStatus(): ?int
    {
        return $this->status;
    }

    public function setStatus(?int $status): self
    {
        $this->status = $status;

        return $this;
    }

    public function getCurLat(): ?float
    {
        return $this->curLat;
    }

    public function setCurLat(?float $curLat): self
    {
        $this->curLat = $curLat;

        return $this;
    }

    public function getCurLon(): ?float
    {
        return $this->curLon;
    }

    public function setCurLon(?float $curLon): self
    {
        $this->curLon = $curLon;

        return $this;
    }

    public function getSn(): ?string
    {
        return $this->sn;
    }

    public function setSn(?string $sn): self
    {
        $this->sn = $sn;

        return $this;
    }

    public function getLoadType(): ?WuliuLoadType
    {
        return $this->loadType;
    }

    public function setLoadType(?WuliuLoadType $loadType): self
    {
        $this->loadType = $loadType;

        return $this;
    }

    public function getContact(): ?string
    {
        return $this->contact;
    }

    public function setContact(?string $contact): self
    {
        $this->contact = $contact;

        return $this;
    }

    public function getTitle(): ?string
    {
        return $this->title;
    }

    public function setTitle(?string $title): self
    {
        $this->title = $title;

        return $this;
    }

    public function getCreateAt(): ?\DateTimeInterface
    {
        return $this->createAt;
    }

    public function setCreateAt(?\DateTimeInterface $createAt): self
    {
        $this->createAt = $createAt;

        return $this;
    }

    public function getCarType(): ?WuliuCarType
    {
        return $this->carType;
    }

    public function setCarType(?WuliuCarType $carType): self
    {
        $this->carType = $carType;

        return $this;
    }
}
